package com.ww.learn.funs

import kotlin.random.Random

fun writeToLog(message: String) {
    println("INFO: $message")
}

fun main() {
    fun getRandomInt(): Int {
        return Random.nextInt(100).also {
            writeToLog("getRandomInt: $it")
        }
    }
    println(getRandomInt())

    fun getRandomInt2(): Int {
        return Random.nextInt(100).also { value ->
            writeToLog("getRandomInt2: $value")
        }
    }
    println(getRandomInt2())
}